<template>
  <div v-if="isWechat" class="wechat-mask">
    <img src="@/assets/weixinbg.png" alt="" width="100%" height="100%" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      isWechat: false
    };
  },
  created() {
    this.isWechat = this.isWechatBrowser();
  },
  methods: {
    isWechatBrowser() {
      const userAgent = navigator.userAgent.toLowerCase();
      return userAgent.includes('micromessenger');
    }
  }
};
</script>

<style scoped>
.wechat-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* 调整透明度 */
  display: flex;
  justify-content: center;
  z-index: 1000;
}
</style>
